package com.xmlstrategys
{
	import com.strategy.IXML;
	import com.utils.Utils;
	
	import flash.utils.ByteArray;
	import flash.utils.Endian;
	
	public class XMLNewSkillsInfo extends XMLBase implements IXML
	{
		public function XMLNewSkillsInfo(data:XML)
		{
			super(data);
		}
		
		public function xmlstrategybml():ByteArray
		{
			var sourceByte:ByteArray = Utils.writeHead(8);
			var nodeLen:uint = xmlData.skills.length();
			sourceByte.writeUnsignedInt(nodeLen);
			
			for each (var xml:XML in xmlData.skills)
			{
				sourceByte.writeInt(xml.@skillid);
				sourceByte.writeInt(xml.@maxLevel);
				
				Utils.writeString(xml.@name1,sourceByte);
				Utils.writeString(xml.@discription,sourceByte);
				
				sourceByte.writeInt(xml.@category);
				sourceByte.writeInt(xml.@familyName);
				sourceByte.writeInt(xml.@attributes);
				sourceByte.writeInt(xml.@attributesEx);
				sourceByte.writeInt(xml.@flags);
				sourceByte.writeInt(xml.@castDistance);
				sourceByte.writeInt(xml.@spellCostType);
				sourceByte.writeInt(xml.@equipItemType);
				sourceByte.writeInt(xml.@equipItemValue);
				sourceByte.writeInt(xml.@maxTargets);
				sourceByte.writeInt(xml.@spellDmgType);
				sourceByte.writeInt(xml.@procFlags);
				sourceByte.writeInt(xml.@effect_1);
				sourceByte.writeInt(xml.@effect_2);
				sourceByte.writeInt(xml.@effectTargetA_1);
				sourceByte.writeInt(xml.@effectTargetA_2);
				sourceByte.writeInt(xml.@effectTargetB_1);
				sourceByte.writeInt(xml.@effectTargetB_2);
				sourceByte.writeInt(xml.@effectTriggerSpell_1);
				sourceByte.writeInt(xml.@effectTriggerSpell_2);
				sourceByte.writeInt(xml.@spellGroupeType);
				sourceByte.writeInt(xml.@casterAuraState);
				sourceByte.writeInt(xml.@targetAuraState);
				sourceByte.writeInt(xml.@castPath);
				
				Utils.writeString(xml.@effectPath,sourceByte);
				Utils.writeString(xml.@content,sourceByte);
				Utils.writeString(xml.@needLv,sourceByte);
				Utils.writeString(xml.@prevSkillid,sourceByte);
				Utils.writeString(xml.@spellCostValue_1,sourceByte);
				Utils.writeString(xml.@spellCostValue_2,sourceByte);
				Utils.writeString(xml.@effectBasePoint_1,sourceByte);
				Utils.writeString(xml.@effectBasePoint_2,sourceByte);
				Utils.writeString(xml.@effectApplyAuraName_1,sourceByte);
				Utils.writeString(xml.@effectApplyAuraName_2,sourceByte);
				Utils.writeString(xml.@spellCDTime,sourceByte);

				
			}
			
			return sourceByte;
		}
	}
}